<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var arr = ['齐', '楚', '燕', '韩', '赵', '魏', '秦']
        var arr1 = arr.slice(1, 4)
        console.log(arr1) // ["楚", "燕", "韩"]

        //splice删除元素
        var arr2 = ['齐', '楚', '燕', '韩', '赵', '魏', '秦']
        arr2.splice(3, 2)
        console.log(arr2) //["齐", "楚", "燕", "魏", "秦"]

        //删后补位
        var arr3 = [12, 15, 16, 52, 26, 63, 38]
        arr3.splice(3, 1, 999999999, 8888888)
        console.log(arr3) // [12, 15, 16, 999999999, 8888888, 26, 63, 38]
    </script>
</body>

</html>